package com.example.qiniutest.aliyun.oss.controller;

import com.example.qiniutest.aliyun.oss.service.IALiYunOSSService;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@RestController
@RequestMapping("aliyun-oss")
public class ALiYunOSSController {

    @Autowired
    private IALiYunOSSService iaLiYunOSSService;

    @PostMapping("/upload")
    public Map<String,String> upload(@NonNull MultipartFile file, @NonNull String path){
        return iaLiYunOSSService.upload(file,path);
    }

}
